package com.antaohua.platfrom.system.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.antaohua.platfrom.system.base.model.BaseBusinessModel;

@Entity
@Table(name="SYS_ROLE_USER")
public class SysRoleUserEntity  extends BaseBusinessModel{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER)
	@JoinColumn(name = "user_id", insertable = false, updatable = false)
	private SysUserEntity user;

	@Column(name = "user_id", length = 36, nullable = false,columnDefinition="char(36)")
	private String userId;
	
	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER)
	@JoinColumn(name = "role_id", insertable = false, updatable = false)
	private SysRoleEntity role;

	@Column(name = "role_id", length = 36, nullable = false,columnDefinition="char(36)")
	private String roleId;

	public SysUserEntity getUser() {
		return user;
	}

	public void setUser(SysUserEntity user) {
		this.user = user;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public SysRoleEntity getRole() {
		return role;
	}

	public void setRole(SysRoleEntity role) {
		this.role = role;
	}

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
	
	
	
	
	
}
